package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.AnyBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.AddCardContract;
import com.seveneight.baijiesteward.ui.user.model.AddCardModel;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/22.
 */

public class AddCardPresenter implements AddCardContract.AddCardPresenter {

    AddCardContract.AddCardView addCardView;
    AddCardContract.AddCardModel addCardModel;

    public AddCardPresenter(AddCardContract.AddCardView addCardView){
        this.addCardView=addCardView;
        addCardModel=new AddCardModel();
    }

    @Override
    public void addCard(Context context, RequestBody body) {
        addCardModel.addCard(context,body, new MyCallBack<AnyBean>() {
            @Override
            public void onSuccess(AnyBean anyBean) {
                addCardView.rebackStatus();
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
